<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        nameList：
        <!-- value表示的是值 -->
        <div v-for="value in nameList">{{value}}</div>
        <hr>
        userInfo：
        <!-- value表示的是值，key表示是字段名 -->
        <div v-for="(value,key) in userInfo">value：{{value}}-----key：{{key}}</div>
        <hr>
        userInfo：
        <!-- value表示的是值，key表示是字段名，index代表索引，从0开始 -->
        <div v-for="(value,key,index) in userInfo">value：{{value}}-----key：{{key}}-----index：{{index}}</div>
        <hr>
        list：
        <div v-for="(value,key,index) in list">value：{{value}}-----key：{{key}}-----index：{{index}}</div>
    </div>
</body>

</html>
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                nameList: ["张三", "李四", "王五"],
                userInfo: {
                    name: "张三",
                    password: "123456"
                },
                list: [
                    {
                        name: "张三",
                        password: "123456"
                    },
                    {
                        name: "张三",
                        password: "123456",
                    },
                    {
                        name: "张三",
                        password: "123456"
                    }

                ]
            }
        },

    })

</script>